﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AUV5.Common
{
    public static class ExtentionMethods
    {
        /// <summary>
        /// 编码HTML文本
        /// </summary>
        /// <param name="txt"></param>
        /// <returns></returns>
        public static string HTMLEnCode(this string txt)
        {
            txt = txt.Replace("<", "&lt;");
            txt = txt.Replace(">", "&gt;");

            return txt;
        }

        /// <summary>
        /// 解码HTML文本
        /// </summary>
        /// <param name="txt"></param>
        /// <returns></returns>
        public static string HTMLDeCode(this string txt)
        {
            txt = txt.Replace("&lt;", "<");
            txt = txt.Replace("&gt;", ">");

            return txt;
        }
    }
}
